#pragma once

#include "xml_helper.hpp"

#include "topcvt_buffer.hpp"
#include "topcvt_pack.hpp"

namespace topcvt
{
	class XmlPack : public PackImp
	{
	protected:
		pugi::xml_document m_doc;
		string m_encoding;
		std::stack<pugi::xml_node*> m_xmlStack;
	public:
		XmlPack() {};
		virtual ~XmlPack() {};

		virtual string packPolicy(PolicyContext& ctx, PolicyCfg& cfg)  override;
		virtual void packField(pugi::xml_node& node, FieldCfg& cfg, PolicyContext& ctx)  override;
		virtual void packStruct(pugi::xml_node& node, StructCfg& cfg, PolicyContext& ctx)  override;
		virtual void packLoop(pugi::xml_node& node, LoopCfg& cfg, PolicyContext& ctx)  override;
	};
};